package cn.sharp.bbs.dao.msg;

import cn.sharp.bbs.entity.DO.msgDto;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @author zhao yu
 */
public interface MsgDao {

    @Update("update t_message set msg_check = 1 where user_id = #{userId} and msg_type = #{type}")
    void read(Long userId, int type);

    @Update("update t_message set msg_check = 1 " +
            "where user_id = #{userId} and msg_from = #{chatRoom} and msg_type = #{letter}")
    void readLetter(Long userId, Long chatRoom, int letter);

    Long getUserIdByPostLike(Long id);

    Long getUserIdByCommentLike(Long id);

    Long getUserIdByCollect(Long id);

    Long getUserIdByFollow(Long id);

    Long getUserIdByPostVersion(Long id);

    Long getAuthorIdByComment(Long id);

    List<Long> getFollowUserIdByComment(Long id);

    Long getCommenterIdByComment(Long key);

    int getUnreadNum(Long userId, int type);

    int getUnreadLetterNum(Long userId, Long chatRoom, int type);

    List<msgDto> likePostMsg(Long id);
    List<msgDto> likeCommentMsg(Long id);

    String getPostName(Long postId);

    List<msgDto> collectMsg(Long id);

    List<msgDto> postCommentMsg(int type, Long id);

    List<msgDto> replyMsg(Long u_id);

    List<msgDto> followMsg(Long id);

    List<msgDto> postCheckMsg(Long id);

    /**
     * userId:report_type
     * targetId:report_target
     */
    List<msgDto> reportMsg(Long u_id);

}
